import java.util.Locale;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-07-17
 * Time: 16:39
 */
public class Test {
    public static void main(String[] args) {
        
    }
    public static void main11(String[] args) {
        String str = " hel loworld ";
        //System.out.println(str.substring(2,5));
        //System.out.println(str.trim());

    }

    public static void main10(String[] args) {
        /*String s = "192.168.1.1";
        String[] s1 = s.split("\\.");
        for (int i = 0; i < s1.length; i++) {
            System.out.println(s1[i]);
        }
        */

        String str = "name=zhangsan&age=18";
        String[] s1 = str.split("&|=");
        for (int i = 0; i < s1.length; i++) {

                System.out.println(s1[i]);

        }

    }

    public static void main9(String[] args) {
        String ss = "hello world hello bit";
        String[] s1 = ss.split(" ",2);
        for (int i = 0; i < s1.length; i++) {
            System.out.println(s1[i]);
        }
    }

    public static void main8(String[] args) {
        String s = "helloworld";
        String s1 = s.replaceAll("l","_");
        System.out.println(s1);
        String s2 = s.replaceFirst("l","_");
        System.out.println(s2);
    }


    public static void main7(String[] args) {
        String s = "hello";
        char[] chars = s.toCharArray();
        for (int i = 0; i < s.length(); i++) {
            System.out.println(chars[i]);
        }

        String s2 = new String(s);
        System.out.println(s);

        String ss = String.format("%d-%d-%d",2019,6,14);
        System.out.println(ss);
    }

    public static void main6(String[] args) {
        String s1 = "hello";
        String s2 = "WORLD";

        System.out.println(s1.toUpperCase());
        System.out.println(s2.toLowerCase());
    }

    public static void main5(String[] args) {
        String s1 = String.valueOf(1234);
        String s2 = String.valueOf('a'+'b'+'c');
        String s3 = String.valueOf(true);
        String s4 = String.valueOf(12.34);
        /*
        System.out.println(s2);
        System.out.println(s3);
        System.out.println(s4);*/

        int data1 = Integer.parseInt(s1);
        System.out.println(s1);
    }

    public static void main4(String[] args) {
        String ss = "abcdefg";
        System.out.println(ss.charAt(2));
        int index = ss.indexOf('c');
        System.out.println(index);
        int index1 = ss.indexOf('c',2);
        System.out.println(index1);
        int index2 = ss.indexOf("ab");
        System.out.println(index2);
        int index3 = ss.lastIndexOf('g');
        System.out.println(index3);

    }

    public static void main3(String[] args) {
        String s1 = new String("ab");
        String s2 = new String("abcde");
        System.out.println(s1.compareTo(s2));
    }
    public static void main2(String[] args) {
        String s1 = new String("Hello") ;
        String s2 = "World";
        String s3 = new String("Hello");

        System.out.println(s1 == s3);

        System.out.println(s1.equalsIgnoreCase(s3));
        System.out.println(s1.equalsIgnoreCase(s2));
    }
    public static void main1(String[] args) {
        String s1 = "Hello World";
        String s2 = new String("Hello World");
        char[] array = {'H','e','l','l','o',' ','b','i','t'};
        String s3 = new String(array);
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s3);
    }

}
